UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UIzbewsGfSytlZ9nz9QftO+gwKPvdl6RdYx+2iUDl/U='
WHERE
key_id = 'd3b93b1b8c680453dab4ead48b4820db1ccc04e5a7e4fa05d9d19a2413ca893f'
AND (
token = 'UIzbewsGfSytlZ9nz9QftO+gwKPvdl6RdYx+2iUDl/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)