UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9pBp5SgcsxMQ+Q6UFSUMdHeeTSoTcO5Dk2BD/tovahM='
WHERE
key_id = '409e3751d74909f456394e546db0f79f8adf9efe5d5a94e81124c6e5fe113d55'
AND (
token = '9pBp5SgcsxMQ+Q6UFSUMdHeeTSoTcO5Dk2BD/tovahM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)