UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '15QCmEoHI81/+rCEn9z3TZF1WGqttazfYxUGEUlMr+g='
WHERE
key_id = '8efca82c4fe2e8a31127f71a2ab8675a32240dc7a05a0866561570a82bea2eed'
AND (
token = '15QCmEoHI81/+rCEn9z3TZF1WGqttazfYxUGEUlMr+g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)