UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L2VIqQsdQU0NHRDSUtSGBGpEjk3CKkvjfkoEC0jpVNs='
WHERE
key_id = '3997b0e00bffc7911cd865acd3533fb45293dfed31fdabcc4411389115a368e3'
AND (
token = 'L2VIqQsdQU0NHRDSUtSGBGpEjk3CKkvjfkoEC0jpVNs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)