UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jWlMy1CH9A4EWFOXVHKgL2LgEyXHuE4Qo1sbnTPpS8M='
WHERE
key_id = '308ecccfecb51e6f4d5232e5051e69eac6f5f41eaea9f60f2ab138ad088e8cd1'
AND (
token = 'jWlMy1CH9A4EWFOXVHKgL2LgEyXHuE4Qo1sbnTPpS8M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)