UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eZxHSqZGyEKKUtP7g9lkK75sLD0tQCKXWsWoGiVVOm0='
WHERE
key_id = '7e0a699dd61375fbb3009380cbd2ba27b1a123d3802387f41bd04c0122d6d04d'
AND (
token = 'eZxHSqZGyEKKUtP7g9lkK75sLD0tQCKXWsWoGiVVOm0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)