UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L/WXxFmTerrLgIGzZEXLIs6Gl9uNTMCLMqVbgMWYJ8w='
WHERE
key_id = 'b52248016c6e9a38e2bcedd5687879fbe00be07508049756fc70a3daa08cbd5f'
AND (
token = 'L/WXxFmTerrLgIGzZEXLIs6Gl9uNTMCLMqVbgMWYJ8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)