UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IHIUCiNqU1xB4DAUe03TRz+yax1l5rtjFPshdOA6jBA='
WHERE
key_id = '5f7960b54f118e99aac1db11abe73615f6f326862afb964de7a3c309a6f319e1'
AND (
token = 'IHIUCiNqU1xB4DAUe03TRz+yax1l5rtjFPshdOA6jBA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)