UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/5gQEERtz+WW1/1Rrt54+yXPOg9pjZSVJyQ/YlPZ0D4='
WHERE
key_id = '15f58e91b7a4db128ada4250a92d1983475ac0e62f42423944165cd09d253b91'
AND (
token = '/5gQEERtz+WW1/1Rrt54+yXPOg9pjZSVJyQ/YlPZ0D4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)