UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0TdMCnYFG1XZadpZYxO6HUsUDRHUZOcKs5MuCE/Jwdc='
WHERE
key_id = '90bb709515f9e24883f754587836250862e1d99ca4e9eeac6c933371d21d3ccc'
AND (
token = '0TdMCnYFG1XZadpZYxO6HUsUDRHUZOcKs5MuCE/Jwdc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)