UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uznmxFOsDAJREjelgDsIVNIvXrDuqhzuGBaBi/Gnzyw='
WHERE
key_id = 'e56b0132755edcf745e286d5a5728cfd5362ddf646132993e51d186d8120d2e5'
AND (
token = 'uznmxFOsDAJREjelgDsIVNIvXrDuqhzuGBaBi/Gnzyw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)