UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NC5/jpVsNZSUZ17R7lzzGLEKVWqTHYNguDO6cMrTiQ4='
WHERE
key_id = '43639f67ff46be309ec15386a09bd5bd5960b5ea527438a35e90bbbfec4943ca'
AND (
token = 'NC5/jpVsNZSUZ17R7lzzGLEKVWqTHYNguDO6cMrTiQ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)