UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZMJLbYwxUl6qylGBgu9hjpQDzTGl6xhm5KDznairvMU='
WHERE
key_id = '5d76bf5860be2f2713983045944146ff8c6431712cae9c92a45a138c9713870f'
AND (
token = 'ZMJLbYwxUl6qylGBgu9hjpQDzTGl6xhm5KDznairvMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)