UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+30nJpGGwneCOKDvrXHqOQSaVgQMYalEe6bhdFNJkYk='
WHERE
key_id = '4e76b26979ab0a9a1e013c074f557eee80a53b4739b469316528e00ad160aa3a'
AND (
token = '+30nJpGGwneCOKDvrXHqOQSaVgQMYalEe6bhdFNJkYk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)