UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cgItJXsYphLhwaBGl1ZIvwGG9XA7/ARgGgeWS8YeSew='
WHERE
key_id = '1083b05a618c6d6a1b166620efef46664bb2039d951575f4a0eaf12463d13420'
AND (
token = 'cgItJXsYphLhwaBGl1ZIvwGG9XA7/ARgGgeWS8YeSew='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)