UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+ZheV0CRLLTV0290wHWEROlbRKaGxzIZzin5gY5qhKQ='
WHERE
key_id = '519fa49125263d237a0c5ae54d7952da3f8649f833b71589a6321826433f4b0b'
AND (
token = '+ZheV0CRLLTV0290wHWEROlbRKaGxzIZzin5gY5qhKQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)