UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2/ndP9VW6H+un0/SRtBhWSnYIxEJKQxOOujKMtEpyH0='
WHERE
key_id = '15aa4beb6d81f98d8cabdb7e6752cffe363c19497d76428d48aeb59a5ba6e506'
AND (
token = '2/ndP9VW6H+un0/SRtBhWSnYIxEJKQxOOujKMtEpyH0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)