UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i1yTQQlpR6VhqGqRkNhxrvH6jh6s44KZ2kj/GwAZB+s='
WHERE
key_id = '726e0bbf45a73335b38569e7aeb1a72b9c75556fe0ee4f4e94ecf90cbb1d4506'
AND (
token = 'i1yTQQlpR6VhqGqRkNhxrvH6jh6s44KZ2kj/GwAZB+s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)