UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F2RPsl3ZGaDPYsD4dD0645Rv2KTKtk2k+SByReAAPoM='
WHERE
key_id = 'ed30f11760a6e144feb499d7ba5c05cc04ab242d518d19f99de6c7244873ef11'
AND (
token = 'F2RPsl3ZGaDPYsD4dD0645Rv2KTKtk2k+SByReAAPoM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)