UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jXiJJZAqpOrEIDgVx2m0D6CTAIkGETf19xO6DXk3F58='
WHERE
key_id = 'b424fe91eca04d63be4b5dd99a819d7958f1e88d86ae3ed98656b69e6e155004'
AND (
token = 'jXiJJZAqpOrEIDgVx2m0D6CTAIkGETf19xO6DXk3F58='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)