UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UvgqTDEtixehCVpW2otOQxuNCCgRIipkC0uGpCNyTFM='
WHERE
key_id = '8f6553c8ce576fb933e9c2bc65b21a8ff9c5a093e9a211533099692e12d57b84'
AND (
token = 'UvgqTDEtixehCVpW2otOQxuNCCgRIipkC0uGpCNyTFM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)