UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wVs5xO5kYDFppTKxNLu/xD1ggciiBAQLugPWjGfvimI='
WHERE
key_id = '756dd322ccdc103445bc92fd2ae960652ee365a7956b5b4a1396207ea6abb9a3'
AND (
token = 'wVs5xO5kYDFppTKxNLu/xD1ggciiBAQLugPWjGfvimI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)