UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GOmqLOFKrs/VHv4SPjK0Q9uWvfPxwRL4HNwzuTbdlxQ='
WHERE
key_id = '3934063e28dc2f14cea396f0062f64fb800e63480587dd3d459e7f7d63d3559b'
AND (
token = 'GOmqLOFKrs/VHv4SPjK0Q9uWvfPxwRL4HNwzuTbdlxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)