UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B8+/4qWYFepKEyIFwYSHU1dYxB75i+XA8e6kfFo9VEU='
WHERE
key_id = 'a0090eb3c7a5d1b60213c67cd953d0041730b90451d2505cf108661566686e88'
AND (
token = 'B8+/4qWYFepKEyIFwYSHU1dYxB75i+XA8e6kfFo9VEU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)