UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gydo5KdDa+tWvwm0V+sCi+wq319C/RG2zlgUVF954bs='
WHERE
key_id = 'eaf27da4aea99037cfd03db0ba613cb95f93a0d8b32126398ac812ca83308d99'
AND (
token = 'gydo5KdDa+tWvwm0V+sCi+wq319C/RG2zlgUVF954bs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)