UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6ikVw+dwHNmuVTwOBiXYxBDxVNZ1Rz++utJ2/8GogIs='
WHERE
key_id = 'b1c32839d884cd80eda13afa26850e9485cb2b7ae28db9c79a7c2448528fb69a'
AND (
token = '6ikVw+dwHNmuVTwOBiXYxBDxVNZ1Rz++utJ2/8GogIs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)