UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ic1DEDsWo7zEN5zgaxkgS/PIIyxNQ7bbJ6THUlVknOE='
WHERE
key_id = '232856b9599efd62fff9cd067c865e0762b1243fae1d39da2c3384186127bb6b'
AND (
token = 'ic1DEDsWo7zEN5zgaxkgS/PIIyxNQ7bbJ6THUlVknOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)