UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OFFGdf4+vO339/rwFCWqqEIEd06G0ZEQWjiHYhhXnvw='
WHERE
key_id = 'f313f154f7f8861e3df02b494d27414dff899f91e67ffb07eae649e77ddab9c7'
AND (
token = 'OFFGdf4+vO339/rwFCWqqEIEd06G0ZEQWjiHYhhXnvw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)