UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '00gNzwyoKzMp34oW2jqw7XFwBfRanvcgLH/GisWmRs0='
WHERE
key_id = 'ab5059f62825b54e8a2b86e950148aceb9c1ff2d67c0ae8356996624798bf859'
AND (
token = '00gNzwyoKzMp34oW2jqw7XFwBfRanvcgLH/GisWmRs0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)