UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zwDgQvopY8Pcmj9iPqLvRHrwZBxaLt/3IdBWB0tY1ac='
WHERE
key_id = 'eae7ba6928b1efbf2952007ff01f655cc39dedb2703d5a858396d0f605ce8aaa'
AND (
token = 'zwDgQvopY8Pcmj9iPqLvRHrwZBxaLt/3IdBWB0tY1ac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)