UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l4c80GcZGrVX2Jn33JC/rEjb38VLdjBjsJiuk6Jvhcc='
WHERE
key_id = '89166c1b64fd8d905271d1b9d68922d365541d0a1b0ce27a08099dcd20cdaa2b'
AND (
token = 'l4c80GcZGrVX2Jn33JC/rEjb38VLdjBjsJiuk6Jvhcc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)