UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nxKo1PTuKLWAYRbpvrDJN6RjcNDlQ795im5D4OT5BkQ='
WHERE
key_id = 'eaa0583c6deba2791830a8672a7566338d0d9c5200d474931d37d263242e2efc'
AND (
token = 'nxKo1PTuKLWAYRbpvrDJN6RjcNDlQ795im5D4OT5BkQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)