UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zW7Gy5G8JhMSsa+s2FzPw9VtFwB4Q1Juaa/K7kx/AU4='
WHERE
key_id = 'd7ec1ffa0666b750d95cd29dbbc3c3a088f581598f0067d08eccaca9cb0a98cc'
AND (
token = 'zW7Gy5G8JhMSsa+s2FzPw9VtFwB4Q1Juaa/K7kx/AU4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)