UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P6zEAByjY14pL02b0F9uHt8XnyzoE14/ZsHcizfew0g='
WHERE
key_id = '0fcf0ac9de4f0599639e6821b1ba07d5a5200debe12da3d732a71a8d40117e54'
AND (
token = 'P6zEAByjY14pL02b0F9uHt8XnyzoE14/ZsHcizfew0g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)